/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.DragonPokerClient.Thread.ClientRequest;

import org.Comunicator.Message;

/**
 *
 * @author davide
 */
public abstract class GenericClientRequest {

    protected GenericClientRequest next = null;

    public abstract void processRequest(Message message);

    public abstract boolean isToProcessing(Message message);

    public void startProcessing(Message message) {
        System.out.println("CLIENT: chain " + getClass().getName());
        if (isToProcessing(message) == true) {
            processRequest(message);
        } else {
            if (next != null) {
                next.startProcessing(message);
            }
        }
    }

    public GenericClientRequest getNext() {
        return next;
    }

    public void setNext(GenericClientRequest next) {
        this.next = next;
    }
}
